package com.one.service;

import com.one.bean.ProductView;
import com.one.util.PageUtil;
import com.one.util.RequestReturn;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: EsService
 * @Auther: yph
 * @Date: 2022/1/17 10:09
 * @Description:
 */
@FeignClient(name = "street-es")
public interface EsService {

    /**
     * @Author: yph
     * @Date: 2022/1/17 10:09
     * @return:
     * @Description: 查询商品数据
     */
    @GetMapping("/product/searchProduct")
    PageUtil<List<ProductView>> searchProduct(
            @RequestParam("sessionId") String sessionId,
            @RequestParam("userId") Integer userId,
            @RequestParam("keyWord") String keyWord,
            @RequestParam("pageNo") Integer pageNo,
            @RequestParam("pageSize") Integer pageSize);

    /**
     * @Author: yph
     * @Date: 2022/1/18 10:16
     * @return:
     * @Description: 查询历史记录
     */
    @GetMapping("/product/searchRecord/{userId}")
    RequestReturn<Map<String,List<String>>> searchRecord(@PathVariable("userId") Integer userId, @RequestParam("sessionId") String sessionId);

}
